Skip to content

[New Rule] SSH Reverse or Dynamic Tunnel on macOS - #7127

Open
litemars wants to merge 9 commits into
mainfrom
new_rule/ssh_reverse_tunnel
Open

litemars wants to merge 9 commits into
mainfrom
new_rule/ssh_reverse_tunnel

Conversation

@litemars

@litemars litemars commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary - What I changed

Adds a new macOS SIEM rule, SSH Reverse or Dynamic Tunnel on macOS
(rules/macos/command_and_control_ssh_reverse_or_dynamic_tunnel.toml).
It brings macOS coverage similar to the Linux SIEM rules Potential Linux Tunneling and/or Port Forwarding and Potential Linux Tunneling and/or Port Forwarding via SSH Option.

TRADE cluster:

image

The detection logic is explained in the sister rule: https://github.com/elastic/endpoint-rules/pull/7880

@litemars litemars self-assigned this Nov 3, 2026
@litemars litemars added OS: macOS Rule: New Proposal for new rule labels Nov 3, 2026
Copilot AI balanced review requested due to automatic review settings November 3, 2026 11:30
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The forwarding predicates miss valid reverse SOCKS invocations and falsely flag non-tunneling remote commands by treating arbitrary command arguments as SSH forwarding options.

2 open issues
What changed in this PR

Adds macOS detection for SSH reverse and dynamic tunneling, extending coverage similar to the existing Linux rules.

Changes:

  • Adds an EQL rule targeting ssh and autossh forwarding options.
  • Includes investigation, remediation, and Elastic Defend setup guidance.
  • Maps activity to Proxy and Protocol Tunneling, with 24-hour alert suppression per host and user.
File Description
rules/​macos/​command_and_control_ssh_reverse_or_dynamic_tunnel.toml Adds the macOS tunneling rule, supporting guidance, threat mappings, and suppression settings.

Review effort: Balanced

@eric-forte-elastic eric-forte-elastic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this rule would also make sense as a cross platform rule? Is there a reason to keep it specific to macOS?

@litemars litemars changed the title [Rule New] SSH Reverse or Dynamic Tunnel on macOS [New Rule] SSH Reverse or Dynamic Tunnel on macOS Nov 3, 2026
@litemars

litemars commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @eric-forte-elastic,

The Windows rule isn’t needed because the Endpoint rule already covers this use case and would block all associated traffic.

For Linux, coverage is split across two separate rules:

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

…toml

Co-authored-by: Bryan Porras <bryan.porras@elastic.co>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

litemars and others added 2 commits December 1, 2026 11:25
…toml

Co-authored-by: Bryan Porras <bryan.porras@elastic.co>
…toml

Co-authored-by: Bryan Porras <bryan.porras@elastic.co>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

…toml

Co-authored-by: Bryan Porras <bryan.porras@elastic.co>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

…toml

Co-authored-by: Bryan Porras <bryan.porras@elastic.co>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

litemars and others added 2 commits December 1, 2026 11:45
Co-authored-by: Bryan Porras <bryan.porras@elastic.co>
Co-authored-by: Bryan Porras <bryan.porras@elastic.co>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

@litemars
litemars requested a review from bryans3c December 1, 2026 10:46
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

Starting the rule tests ...

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants